<?php

class Member_Profile extends Controller {
	
	function Member_Profile()
	{
		parent::Controller();
		$status = $this->session->userdata('status');
		if(!isset($status) || $status != 'OK') {
			redirect('onlineaide');
		} else {
			$this->user = $this->session->userdata('user');
			$this->load->model('User');
			$query = $this->User->getLastLogOut($this->user);
			if ($query->num_rows() > 0)
			{
   				$row = $query->row_array();
				$date = $row['LastLogOut'];
				if($date == "0000-00-00") {
					$this->last="This is your first visit!";
				} else {
					$this->last = $row['LastLogOut'];}
			}
			
		}
	}

	function index()
	{
		redirect('user_control/home');
	}
}
?>
